function buildCal(m, y, cM, cH, cDW, cD, brdr)
	{
	var mn=['Januari','Februari','Maart','April','Mei','Juni','Juli','Augustus','September','Oktober','November','December'];
	var dim=[31,0,31,30,31,30,31,31,30,31,30,31];
	var dag = ['Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag'];
	var mnNum = ['1','2','3','4','5','6','7','8','9','10','11','12'];
	var today = true;
	
	var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
	oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st
	
	var todaydate=new Date() //DD added
	var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0 //DD added
	
	dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
	var t='<div class="'+cM+'"><table class="'+cM+'" cols="7" cellpadding="0" cellspacing="0"><tr align="center">';
	t+='<td colspan="7" align="right" class="'+cH+'">'+mn[m-1]+' - '+y+'</td></tr><tr align="center">';
	for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+dag[s]+'</td>';
	t+='</tr><tr align="center">';
	for(i=1;i<=42;i++){
	var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : '&nbsp;';
	
	if (x==scanfortoday) //DD added
			{
				today = true;
			}
	if(!today)
		t+='<td class="'+cD+'"><a href="index.php?page=bowling&dag='+x+'&maand='+mnNum[m-1]+'&jaar='+y+'">'+x+'</a></td>';
	else
		{
			t+='<td class="'+cD+'"><a href="index.php?page=bowling&dag='+x+'&maand='+mnNum[m-1]+'&jaar='+y+'"><span id="today">'+x+'</span></a></td>';
			today = false;
		}
	if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
	}
	return t+='</tr></table></div>';
	}

